#include "Sa2dDom.h"



configurationfile::configurationfile() {
	constructor();
}

configurationfile::configurationfile(string fileDate) {
	file_date = fileDate;
	constructor();
}

void configurationfile::setFileName(string name){
	this->file_name = name;
}

string configurationfile::getFileName(){
	return file_name;
}

void configurationfile::constructor(){

	mySimulation = new simulation();
	cout<<"simulation ok\n";
	myArena = new arena();
	cout<<"arena ok\n";
}



string configurationfile::getFileDate() {
	return file_date;
}

vector<agentSet*> configurationfile::getAgentSets() {
	return agentSetVector;
}

arena* configurationfile::getArena(){
	return myArena;
}

simulation* configurationfile::getSimulation() {
	return mySimulation;
}

void configurationfile::setFileDate(string file_date) {
	this->file_date = file_date;
}

void configurationfile::addAgent(agentSet * anAgent){
	agentSetVector.push_back(anAgent);
}

string  configurationfile::toString(int indent){
	stringstream returnString;
	string tabs = this->getIndent(indent);
	returnString << tabs <<"configurationfile:\n"<<"\n";
	returnString << tabs <<mySimulation->toString(indent+1)<<"\n";
	returnString << tabs << myArena->toString(indent+1);

	for ( int i = 0; i < agentSetVector.size(); i++ ){
		returnString<<agentSetVector[i]->toString(indent+1);
	}

	return returnString.str();
}

configurationfile::~configurationfile(){
	delete myArena;
	delete mySimulation;
}
